package org.grayrabbit.cms.entity;

// Generated 2011-5-16 13:39:30 by Hibernate Tools 3.3.0.GA

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * CmsVoteRecord generated by hbm2java
 */
@Entity
@Table(name = "CMS_VOTE_RECORD")
public class VoteRecord implements java.io.Serializable {

	private static final long serialVersionUID = -8859037301810421863L;
	private String voteRecordId;
	private Vote vote;
	private VoteOption voteOption;
	private String voteIp;
	private String voteUserName;
	private Date createTime;
	
	public VoteRecord() {
	}

	public VoteRecord(String voteRecordId) {
		this.voteRecordId = voteRecordId;
	}

	@Id
	@Column(name = "VOTE_RECORD_ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid") 
	public String getVoteRecordId() {
		return this.voteRecordId;
	}

	public void setVoteRecordId(String voteRecordId) {
		this.voteRecordId = voteRecordId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "VOTE_ID")
	public Vote getVote() {
		return vote;
	}

	public void setVote(Vote vote) {
		this.vote = vote;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "VOTE_OPTION_ID")
	public VoteOption getVoteOption() {
		return voteOption;
	}

	public void setVoteOption(VoteOption voteOption) {
		this.voteOption = voteOption;
	}

	@Column(name = "VOTE_IP", length = 64)
	public String getVoteIp() {
		return this.voteIp;
	}

	public void setVoteIp(String voteIp) {
		this.voteIp = voteIp;
	}

	@Column(name = "VOTE_USER_NAME", length = 64)
	public String getVoteUserName() {
		return this.voteUserName;
	}

	public void setVoteUserName(String voteUserName) {
		this.voteUserName = voteUserName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME", length = 7)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	
}
